<?php
/**
 * Created by PhpStorm.
 * User: alice
 * Date: 2015/12/26
 * Time: 14:14
 */

/**
 * Class Involved_ProjectModel
 */

class Involved_InvestRecordModel extends BaseModel
{

    protected $table = 'invest_record';

    /**
     * 获取投资记录列表
     */
    public function InvestRecordList(){
        return  DB::table($this->table)
            ->selectRaw('ypt_invest_record.invest_id,ypt_invest_record.project_name,ypt_invest_record.invest_money,ypt_invest_record.invest_time,ypt_invest_record.yield_rate,ypt_invest_record.limit,ypt_invest_record.yield_money,ypt_invest_record.status,ypt_user.user_name as user_id,ypt_invest_record.type')
            ->leftjoin('user','invest_record.user_id','=','user.user_id')
            ->get();
    }


    /**
     * 获取投资记录列表
     */
    public function GetInvestRecordOne($id){
        return  DB::table($this->table)
            ->where('invest_record.invest_id',$id)
            ->first();
    }
}